
try:
    import xml.etree.cElementTree as ET
except ImportError:
    import xml.etree.ElementTree as ET

pos_file = '/home/sean/data/ILSVRC/ILSVRC2014_devkit/data/det_lists/train_pos_124.txt'
xml_dir = '/home/sean/data/ILSVRC/Annotations/DET/ILSVRC2014_DET_train/'
for line in open(pos_file, 'r'):
    xml_file = xml_dir+line+'.xml'
    print(xml_file)
    tree = ET.parse(xml_file)
    root_node = tree.getroot()
    object = root_node.find('object')


